package com.x.Part4_抽象类.练习;

import java.util.Scanner;

/**
 * ClassName: PayrollSystem
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.03.04 22:12
 */
public class PayrollSystem {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        Employee[] ems = new Employee[2];

        ems[0] = new SaraliedEmployee(new MyDate(1999,1,1),"hx",1018,18000);
        ems[1] = new HourlyEmployee(new MyDate(2001,8,3),"ws",1019,80,200);

        System.out.println("输入当前月份: ");
        int month = scanner.nextInt();



        for(int i=0;i<ems.length;i++){
            System.out.println(ems[i].toString());

            if(month == ems[i].getBirthday().getMonth()){
                System.out.println("生日");
            }
            System.out.println("earning: "+ems[i].earnings());
        }

        scanner.close();

    }
}
